package Server;

import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Scanner;

import map.MapLayer;

public class ServerConnection implements Runnable
{
	Scanner in;
	DataOutputStream out;
	
	MapLayer ml;
	
	public ServerConnection(Scanner in, DataOutputStream out, MapLayer ml)
	{
		this.in = in;
		this.out = out;
		
		this.ml = ml;
	}
	
	@Override
	public void run() 
	{
		try 
		{
			while (true)
			{
				out.writeBytes(ml.toString() + "\n");
			}
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
	}
	
	public void listen()
	{
		while (true)
		{
			String incomingMessage = in.nextLine();
		}
	}

}
